#include <iostream>
#include <tbb/task_group.h>
#include <tbb/parallel_invoke.h>
#include <string>
#include <thread>

using namespace tbb;
using namespace std;

int main() {

    string s = "hello,world";
    char ch = 'd';

    tbb:parallel_invoke(
        [&] {
            for (size_t i = 0; i < s.size() / 2; ++i) {
                if (s[i] == ch) cout << "found" << endl;
            }
        },
        [&] {
            for (size_t i = s.size() / 2; i < s.size(); ++i) {
                if (s[i] == ch) cout << "found" << endl;
            }
        }
    );
    
    return 0;
}